<?php

namespace app\popo\vo;

use app\popo\BaseVO;

/**
 * 订单统计VO
 */
class OrderReportVO extends BaseVO
{
    /**
     * 日期，以逗号分隔，例如：2022-10-01,2022-10-02,2022-10-03
     */
    public string $dateList;

    /**
     * 每日订单数，以逗号分隔，例如：260,210,215
     */
    public string $orderCountList;

    /**
     * 每日有效订单数，以逗号分隔，例如：20,16,10
     */
    public string $validOrderCountList;

    /**
     * 订单总数
     */
    public int $totalOrderCount;

    /**
     * 有效订单数
     */
    public int $validOrderCount;

    /**
     * 订单完成率
     */
    public float $orderCompletionRate;

    public function getDateList(): string
    {
        return $this->dateList ?? '';
    }

    public function setDateList(string $dateList): void
    {
        $this->dateList = $dateList;
    }

    public function getOrderCountList(): string
    {
        return $this->orderCountList ?? '';
    }

    public function setOrderCountList(string $orderCountList): void
    {
        $this->orderCountList = $orderCountList;
    }

    public function getValidOrderCountList(): string
    {
        return $this->validOrderCountList ?? '';
    }

    public function setValidOrderCountList(string $validOrderCountList): void
    {
        $this->validOrderCountList = $validOrderCountList;
    }

    public function getTotalOrderCount(): int
    {
        return $this->totalOrderCount ?? 0;
    }

    public function setTotalOrderCount(int $totalOrderCount): void
    {
        $this->totalOrderCount = $totalOrderCount;
    }

    public function getValidOrderCount(): int
    {
        return $this->validOrderCount ?? 0;
    }

    public function setValidOrderCount(int $validOrderCount): void
    {
        $this->validOrderCount = $validOrderCount;
    }

    public function getOrderCompletionRate(): float
    {
        return $this->orderCompletionRate ?? 0.0;
    }

    public function setOrderCompletionRate(float $orderCompletionRate): void
    {
        $this->orderCompletionRate = $orderCompletionRate;
    }

    public function toArray(): array
    {
        return [
            'dateList' => $this->dateList ?? '',
            'orderCountList' => $this->orderCountList ?? '',
            'validOrderCountList' => $this->validOrderCountList ?? '',
            'totalOrderCount' => $this->totalOrderCount ?? 0,
            'validOrderCount' => $this->validOrderCount ?? 0,
            'orderCompletionRate' => $this->orderCompletionRate ?? 0.0
        ];
    }
}